﻿using System.Web.Mvc;
using System.Web.Mvc.Html;
using DevelopmentKit.Cms.Domain;
using DevelopmentKit.Cms.Enums;

namespace DevelopmentKit.Cms.Helper
{
    public static class HtmlHelperEx            
    {


        public static MvcHtmlString Edit(this HtmlHelper htmlHelper, ContentProperty property, string value)
        {
            switch (property.PropertyType)
            {
                case PropertyType.Text:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.File:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.Image:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.Images:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.LongText:
                    return htmlHelper.TextArea(property.Name, value, new { @class = "text-long" });
                case PropertyType.Multiple:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.Radio:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" });
                case PropertyType.Html:
                    return htmlHelper.TextBox(property.Name, value, new { @class = "text-long" }); 
            }
            return new MvcHtmlString("");
        }
    }
} 